#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <random>
int sumOfPrimes(long num) {
        std::vector<bool> isPrime(num+1, true);
        isPrime[0] = false;
        isPrime[1] = false;
        for (int i = 2; i <= std::sqrt(num); i++) {
                if (isPrime[i]) {
                for (int j = i*i; j <= num; j += i) {
                        isPrime[j] = false;
                }
        }
}

    long sum = 0;
    for (int i = 2; i <= num; i++) {
        if (isPrime[i]) {
            sum += i;

        }
    }
    return sum;
}



int main(){

	srand(time(NULL)); // инициализация генератора случайных чисел

	long num = rand() % (1000000 - 100000 + 1) + 100000;
	//long num = 14345;
	long sum = sumOfPrimes(num/100);
	std::cout<<num/100<<std::endl;

	std::cout<<sum%100<<std::endl;

}
